package com.test2.proxy;

import com.test2.service.UserService;
import com.test2.service.UserServiceImpl;

public class Proxy02 implements  UserService{

    private UserService userService;


    public void setUserService(UserService userService) {
        this.userService = userService;
    }


    public void log(String msg){
        System.out.println("[Debug]调用了"+msg);
    }

    @Override
    public void add() {
        this.log("add");
        userService.add();
    }

    @Override
    public void delete() {
        this.log("delete");
        userService.delete();
    }

    @Override
    public void update() {
        this.log("update");
        userService.update();
    }

    @Override
    public void query() {
        this.log("query");
        userService.query();
    }
}
